package com.myapp.ruyixing.model;

import java.io.Serializable;
import java.util.List;

import android.text.TextUtils;

public class Airline {
	
	public List<AirlineSearchItem> list;

	public static class AirlineSearchItem implements Serializable {
		/**
		 * 
		 */
		private static final long serialVersionUID = 4946964684478674186L;
		public String time_go;
		public String airportName_go;
		public String planeinfo_go;
		public String price_go;
		public String airportfee;
		public String fuelfee;
		
		public String date;
		public String fromName;
		public String toName;
		
		public String fromCity;
		public String toCity;
		
		public String getTimeStart() {
			if (!TextUtils.isEmpty(time_go)) {
				String[] array = time_go.split("—");
				if (array.length > 1) {
					return array[0].trim();
				}
			}
			
			return "";
		}
		
		public String getTimeArrive() {
			if (!TextUtils.isEmpty(time_go)) {
				String[] array = time_go.split("—");
				if (array.length > 1) {
					return array[1].trim();
				}
			}
			
			return "";
		}
		
		public String getAirportFrom() {
			if (!TextUtils.isEmpty(airportName_go)) {
				String[] array = airportName_go.split("—");
				if (array.length > 1) {
					return array[0].trim();
				}
			}
			
			return "";
		}
		
		public String getAirportArrive() {
			if (!TextUtils.isEmpty(airportName_go)) {
				String[] array = airportName_go.split("—");
				if (array.length > 1) {
					return array[1].trim();
				}
			}
			
			return "";
		}
		
		public String getAircode() {
			if (!TextUtils.isEmpty(planeinfo_go)) {
				String[] array = planeinfo_go.split(" ");
				if (array.length > 1) {
					return array[1].trim();
				}
			}
			
			return "";
		}
		
		public String getAirCompany() {
			if (!TextUtils.isEmpty(planeinfo_go)) {
				String[] array = planeinfo_go.split(" ");
				if (array.length > 0) {
					return array[0].trim();
				}
			}
			
			return "";
		}
		
		public String getAirType() {
			if (!TextUtils.isEmpty(planeinfo_go)) {
				String[] array = planeinfo_go.split(" ");
				if (array.length > 2) {
					return array[2].trim();
				}
			}
			
			return "";
		}
	}
}
